contacts = {"老余", "老林", "老陈", "老曾", "老李", "老张"}
year = "虎"
for name in contacts:
    message_content = """
    律回春渐，新元肇启。
    新岁甫至，福气东来。
    金{0}贺岁，欢乐祥瑞。
    金{0}敲门，五福临门。
    给{1}及家人拜年啦!
    新春快乐，{0}年大吉!
    """.format(year, name)
    #     message_content = """
    #     律回春渐，新元肇启。
    #     新岁甫至，福气东来。
    #     金{current_year}贺岁，欢乐祥瑞。
    #     金{current_year}敲门，五福临门。
    #     给{receiver_name}及家人拜年啦!
    #     新春快乐，{current_year}年大吉!
    #     """.format(current_year = year, receiver_name = name)   # 左边括号内顺序可交换
    print(message_content)
gpa_dict = {"小明": 3.788, "小花": 3.892, "小红": 3.905}
for name_gpa in gpa_dict:
    gpa = gpa_dict[name_gpa]
    print("{0}你好，你的当前绩点为{1:.2f}".format(name_gpa, gpa))
